(function() { tinymce.PluginManager.requireLangPack('insertcode'); tinymce.create('tinymce.plugins.InsertCode', { init: function(ed, url) { ed.addCommand('mceInsertCode', function() { ed.windowManager.open({ file: url + '/dialog.htm', width: 480 + parseInt(ed.getLang('insertcode.delta_width', 0)), height: 320 + parseInt(ed.getLang('insertcode.delta_height', 0)), inline: 1 }, { plugin_url: url, some_custom_arg: 'custom arg' }) }); ed.addButton('insertcode', { title: 'insertcode.desc', cmd: 'mceInsertCode', image: url + '/img/code.png' }); ed.onNodeChange.add(function(ed, cm, n) { cm.setActive('insertcode', n.nodeName == 'IMG') }) }, createControl: function(n, cm) { return null }, getInfo: function() { return { longname: 'Insert Code plugin', author: 'Rtur.net', authorurl: 'http://rtur.net', infourl: 'http://rtur.net/blog/post/2009/11/26/Building-custom-plugin-for-TinyMCE.aspx', version: "1.0"} } }); tinymce.PluginManager.add('insertcode', tinymce.plugins.InsertCode) })();